<script>
    $(function() {
        $("a").button();
        $("#confirm").button();
        $("a").click(function() { return true; });
    });

    function checkInput(){
        if($("#new_password").val()==""){
            alert("new password ต้องไม่เป็นช่องว่าง");
            $("#new_password").focus();
            return false;
        }

        if($("#confirm_password").val()==""){
            alert("confirm_password ต้องไม่เป็นช่องว่าง");
            $("#confirm_password").focus();
            return false;
        }

        if($("#new_password").val()!=$("#confirm_password").val()){
            alert("new password กับ confirm password ไม่ตรงกัน");
            $("#new_password").focus();
            return false;
        }     
    }

    
</script>
<div style="width: 100%;height: 100%;background-color: silver" align="center" class="ui-widget ui-corner-all">
    <br>
<form method="post" action="<?php URL::base()?>changepassword" target="" onsubmit="return checkInput()">
    <table width="500" class="ui-widget ui-widget-content ui-corner-all" cellspacing="0" cellpadding="3">
            <thead><tr class="ui-widget-header"><td colspan="5">แก้ไข Password</td></tr></thead>
            <tbody align="left">
                <tr><td valign="top" style="padding-left: 10px">Old password</td><td><input type="password" id="password" name="password"  </td></tr>
                <tr><td valign="top" style="padding-left: 10px">New password </td><td><input type="password" id="new_password" name="new_password"> </td></tr>
                <tr><td valign="top" style="padding-left: 10px">Confirm New Password</td><td><input type="password" id="confirm_password" name="confirm_password"> </td></tr>
                <tr><td align="center" colspan="2"><input class="ui-button ui-widget ui-state-default ui-corner-all" type="submit" id="confirm" value="ยืนยันการแก้ไข">
                    </td></tr>
                <tr><td align="center" colspan="2"><a href="<?php echo url::base()?>/doctor/listPatient">กลับ</a></td></tr>
                <tr><td colspan="8" align="left" style="color: blue"><?php echo $message ?></td></tr>
            </tbody>
        </table>        
        <input type="hidden" value="changepassword" name="method">
    </form>
</div>
